import { Router } from 'hyper-express';
import requireUser from '../../../middlewares/auth/requireUser';
import cache from '../../../middlewares/cache';
import rowLevelPermission from '../../../middlewares/auth/rowLevelPermission';
//#region AutoCreateCode
import { uctooWechatopenAppletController } from '../../../controllers';
const uctoowechatopenAppletRouter = new Router();
const wechatopenAppletController = new uctooWechatopenAppletController();

uctoowechatopenAppletRouter.post('/add', requireUser, wechatopenAppletController.add);
uctoowechatopenAppletRouter.post('/edit', requireUser, rowLevelPermission('uctoo/wechatopen_applet'), wechatopenAppletController.edit);
uctoowechatopenAppletRouter.post('/del', requireUser, rowLevelPermission('uctoo/wechatopen_applet'), wechatopenAppletController.delete);

//For getting wechatopenApplet with permission control
uctoowechatopenAppletRouter.get('/:id', requireUser,  rowLevelPermission('uctoo/wechatopen_applet'), wechatopenAppletController.getSingle);
uctoowechatopenAppletRouter.get('/:limit/:page', requireUser,  rowLevelPermission('uctoo/wechatopen_applet'), wechatopenAppletController.getMany);
uctoowechatopenAppletRouter.get('/:limit/:page/:skip', requireUser,  rowLevelPermission('uctoo/wechatopen_applet'), wechatopenAppletController.getMany);

//#endregion AutoCreateCode
uctoowechatopenAppletRouter.post('/officialaccountserver', wechatopenAppletController.officialAccountServer);
export default uctoowechatopenAppletRouter;
